package com.study.dto;

import com.github.pagehelper.PageInfo;
import com.study.entity.Counties;

import java.util.List;

/**
 * @author lxl
 * @version 2022-06-21 00:39
 */

public class MyPage<T> {
    /**
     * 当前页
     */
    private Integer current;
    /**
     * 每页最大记录数
     */
    private Integer rowMax;
    /**
     * 总页数
     */
    private Long total;
    /**
     * 结果集
     */
    private List<T> data;

    public MyPage<T> init(PageInfo<T> pageInfo) {
        this.current = pageInfo.getPageNum();
        this.rowMax = pageInfo.getPageSize();
        this.total = pageInfo.getTotal();
        this.data = pageInfo.getList();
        return this;
    }

    public Integer getCurrent() {
        return current;
    }

    public void setCurrent(Integer current) {
        this.current = current;
    }

    public Integer getRowMax() {
        return rowMax;
    }

    public void setRowMax(Integer rowMax) {
        this.rowMax = rowMax;
    }

    public Long getTotal() {
        return total;
    }

    public void setTotal(Long total) {
        this.total = total;
    }

    public List<T> getData() {
        return data;
    }

    public void setData(List<T> data) {
        this.data = data;
    }


}
